xen: remove extern function declarations from C files.
authorTim Deegan <Tim.Deegan@citrix.com>
Thu, 26 May 2011 11:37:47 +0000 (12:37 +0100)
committerTim Deegan <Tim.Deegan@citrix.com>
Thu, 26 May 2011 11:37:47 +0000 (12:37 +0100)
Move all extern declarations into appropriate header files.
This also fixes up a few places where the caller and the definition
had different signatures.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
54 files changed:
xen/arch/x86/acpi/cpu_idle.c
xen/arch/x86/cpu/mtrr/main.c
xen/arch/x86/cpu/mtrr/mtrr.h
xen/arch/x86/debug.c
xen/arch/x86/domctl.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/nestedhvm.c
xen/arch/x86/hvm/vmsi.c
xen/arch/x86/ioport_emulate.c
xen/arch/x86/irq.c
xen/arch/x86/machine_kexec.c
xen/arch/x86/mm/p2m-pod.c
xen/arch/x86/mm/p2m-pt.c
xen/arch/x86/mm/p2m.c
xen/arch/x86/mm/paging.c
xen/arch/x86/physdev.c
xen/arch/x86/platform_hypercall.c
xen/arch/x86/smpboot.c
xen/arch/x86/sysctl.c
xen/arch/x86/traps.c
xen/arch/x86/x86_32/traps.c
xen/arch/x86/x86_64/cpu_idle.c
xen/arch/x86/x86_64/cpufreq.c
xen/common/cpupool.c
xen/common/domctl.c
xen/common/kernel.c
xen/common/keyhandler.c
xen/common/sysctl.c
xen/drivers/passthrough/io.c
xen/drivers/passthrough/vtd/x86/vtd.c
xen/include/asm-x86/acpi.h
xen/include/asm-x86/debugger.h
xen/include/asm-x86/hap.h
xen/include/asm-x86/hpet.h
xen/include/asm-x86/hvm/hvm.h
xen/include/asm-x86/hypercall.h
xen/include/asm-x86/io.h
xen/include/asm-x86/io_apic.h
xen/include/asm-x86/irq.h
xen/include/asm-x86/numa.h
xen/include/asm-x86/p2m.h
xen/include/asm-x86/processor.h
xen/include/asm-x86/setup.h
xen/include/asm-x86/shadow.h
xen/include/asm-x86/x86_64/uaccess.h
xen/include/xen/cpuidle.h
xen/include/xen/kexec.h
xen/include/xen/pci.h
xen/include/xen/perfc.h
xen/include/xen/pmstat.h
xen/include/xen/sched.h
xen/include/xen/spinlock.h
xen/include/xsm/xsm.h
xen/xsm/xsm_core.c

index 064d235e9582d3f5840346a40e98d1922e5ab494..23e8d3991ef7fb7592a2d02fe7b2927978215778 100644 (file)
@@ -72,10 +72,6 @@ static uint64_t (*ticks_elapsed)(uint64_t t1, uint64_t t2);
 static uint64_t (*tick_to_ns)(uint64_t ticks);
 static uint64_t (*ns_to_tick)(uint64_t ticks);
 
-extern void (*pm_idle) (void);
-extern void (*dead_idle) (void);
-extern void menu_get_trace_data(u32 *expected, u32 *pred);
-
 static void (*pm_idle_save) (void) __read_mostly;
 unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER - 1;
 integer_param("max_cstate", max_cstate);
index b1a88474bd5e32d583aae7608e5593b45cb5056a..968d8bd9599da8ee27e09af46447b75264fbe4d3 100644 (file)
@@ -580,9 +580,6 @@ mtrr_del(int reg, unsigned long base, unsigned long size)
  * These should be called implicitly, but we can't yet until all the initcall
  * stuff is done...
  */
-extern void amd_init_mtrr(void);
-extern void cyrix_init_mtrr(void);
-
 static void __init init_ifs(void)
 {
 #ifndef CONFIG_X86_64
index f72cbbb1749d18cdfff252136c1a4ccf21937d54..429a1427427b00da2423608ffcf06edc9d793270 100644 (file)
@@ -83,3 +83,6 @@ extern unsigned int num_var_ranges;
 void mtrr_state_warn(void);
 void mtrr_wrmsr(unsigned int msr, uint64_t msr_content);
 
+extern int amd_init_mtrr(void);
+extern int cyrix_init_mtrr(void);
+
index 62b5a1544d4831f61bc9c924d123f855600034b6..449f5bd5b0bdd3d84f6d10a1b7e4ce4e45bbe3b8 100644 (file)
@@ -22,6 +22,7 @@
 #include <xen/mm.h>
 #include <xen/domain_page.h>
 #include <xen/guest_access.h>
+#include <asm/debugger.h>
 #include <asm/p2m.h>
 
 /* 
@@ -30,8 +31,8 @@
  */
 
 #ifdef XEN_KDB_CONFIG
-extern volatile int kdbdbg;
-extern void kdbp(const char *fmt, ...);
+#include "../kdb/include/kdbdefs.h"
+#include "../kdb/include/kdbproto.h"
 #define DBGP(...) {(kdbdbg) ? kdbp(__VA_ARGS__):0;}
 #define DBGP1(...) {(kdbdbg>1) ? kdbp(__VA_ARGS__):0;}
 #define DBGP2(...) {(kdbdbg>2) ? kdbp(__VA_ARGS__):0;}
@@ -40,10 +41,6 @@ extern void kdbp(const char *fmt, ...);
 #define DBGP2(...) {0;}
 #endif
 
-typedef unsigned long dbgva_t;
-typedef unsigned char dbgbyte_t;
-
-
 /* Returns: mfn for the given (hvm guest) vaddr */
 static unsigned long 
 dbg_hvm_va2mfn(dbgva_t vaddr, struct domain *dp, int toaddr)
index d13599aed3b898205b45f2d94ee0a31b9541efe8..4c0c0122f888898652fff6bf6ae100054ff115f0 100644 (file)
 #include <public/mem_event.h>
 #include <asm/mem_sharing.h>
 #include <asm/xstate.h>
-
-#ifdef XEN_KDB_CONFIG
-#include "../kdb/include/kdbdefs.h"
-#include "../kdb/include/kdbproto.h"
-#else
-typedef unsigned long kdbva_t;
-typedef unsigned char kdbbyt_t;
-extern int dbg_rw_mem(kdbva_t, kdbbyt_t *, int, domid_t, int, uint64_t);
-#endif
+#include <asm/debugger.h>
 
 static int gdbsx_guest_mem_io(
     domid_t domid, struct xen_domctl_gdbsx_memio *iop)
 {   
     ulong l_uva = (ulong)iop->uva;
     iop->remain = dbg_rw_mem(
-        (kdbva_t)iop->gva, (kdbbyt_t *)l_uva, iop->len, domid,
+        (dbgva_t)iop->gva, (dbgbyte_t *)l_uva, iop->len, domid,
         iop->gwr, iop->pgd3val);
     return (iop->remain ? -EFAULT : 0);
 }
@@ -732,8 +724,6 @@ long arch_do_domctl(
 
         case XEN_DOMCTL_SENDTRIGGER_SLEEP:
         {
-            extern void hvm_acpi_sleep_button(struct domain *d);
-
             ret = -EINVAL;
             if ( is_hvm_domain(d) ) 
             {
index b02be7b3edc677ffb74aef253c3591828f1a7eb0..35bec23b750e7ff00eb8d92c7cb6a7cc13bb582d 100644 (file)
@@ -108,10 +108,6 @@ static struct notifier_block cpu_nfb = {
 
 static int __init hvm_enable(void)
 {
-    extern struct hvm_function_table *start_svm(void);
-    extern struct hvm_function_table *start_vmx(void);
-    extern int hvm_port80_allowed;
-
     struct hvm_function_table *fns = NULL;
 
     switch ( boot_cpu_data.x86_vendor )
@@ -502,8 +498,6 @@ int hvm_domain_initialise(struct domain *d)
     return rc;
 }
 
-extern void msixtbl_pt_cleanup(struct domain *d);
-
 void hvm_domain_relinquish_resources(struct domain *d)
 {
     hvm_destroy_ioreq_page(d, &d->arch.hvm_domain.ioreq);
@@ -1377,8 +1371,6 @@ int hvm_set_efer(uint64_t value)
     return X86EMUL_OKAY;
 }
 
-extern void shadow_blow_tables_per_domain(struct domain *d);
-
 /* Exit UC mode only if all VCPUs agree on MTRR/PAT and are not in no_fill. */
 static bool_t domain_exit_uc_mode(struct vcpu *v)
 {
index 7c77e9cbc438b65a346fae749e6f68768b4d2a3a..f77b84c286453e9ab3b0ea3ceb55276f1fc82796 100644 (file)
@@ -200,7 +200,6 @@ unsigned long *
 nestedhvm_vcpu_iomap_get(bool_t port_80, bool_t port_ed)
 {
     int i;
-    extern int hvm_port80_allowed;
 
     if (!hvm_port80_allowed)
         port_80 = 1;
index eee802adb0f6a600f9343c3ef25000d5e2d47677..cba074852f9d01ed81df4247ad9467dfc23e8628 100644 (file)
@@ -447,7 +447,7 @@ found:
     spin_unlock_irq(&irq_desc->lock);
 }
 
-void msixtbl_pt_cleanup(struct domain *d, int pirq)
+void msixtbl_pt_cleanup(struct domain *d)
 {
     struct msixtbl_entry *entry, *temp;
     unsigned long flags;
index d76f1ea5679455bc9d9afe17acd0e74499d522e0..b3d0ce9e3eb4bc5cdf6bfdd649b7313e3dcca7e1 100644 (file)
@@ -9,10 +9,6 @@
 #include <xen/sched.h>
 #include <xen/dmi.h>
 
-/* Function pointer used to handle platform specific I/O port emulation. */
-extern void (*ioemul_handle_quirk)(
-    u8 opcode, char *io_emul_stub, struct cpu_user_regs *regs);
-
 static void ioemul_handle_proliant_quirk(
     u8 opcode, char *io_emul_stub, struct cpu_user_regs *regs)
 {
index 43aa1a956870f6b157721baec1eac81b98043b7c..635c7801f9938493f545b9a05901f3c81915eb01 100644 (file)
@@ -1708,8 +1708,6 @@ void free_domain_pirqs(struct domain *d)
     spin_unlock(&pcidevs_lock);
 }
 
-extern void dump_ioapic_irq_info(void);
-
 static void dump_irqs(unsigned char key)
 {
     int i, irq, pirq;
index c998377dbb96d1753482a79a8c3300d8850667bf..d24ad217836c71aa2d2a44c2b688cc51754633c2 100644 (file)
@@ -21,9 +21,6 @@ typedef void (*relocate_new_kernel_t)(
 #endif
                 unsigned int preserve_context);
 
-extern int machine_kexec_get_xen(xen_kexec_range_t *range);
-
-
 int machine_kexec_load(int type, int slot, xen_kexec_image_t *image)
 {
     unsigned long prev_ma = 0;
@@ -101,10 +98,6 @@ void machine_kexec(xen_kexec_image_t *image)
 #ifdef CONFIG_COMPAT
     if ( is_pv_32on64_domain(dom0) )
     {
-        extern void compat_machine_kexec(unsigned long rnk,
-                                         unsigned long indirection_page,
-                                         unsigned long *page_list,
-                                         unsigned long start_address);
         compat_machine_kexec(image->page_list[1],
                              image->indirection_page,
                              image->page_list,
index fc0601c045091909c389997b668ac6044e3ea1a4..2e2dfbf18db11c92339e5099c018c2cf8c589c81 100644 (file)
 #include <asm/hvm/nestedhvm.h>
 #include <asm/hvm/svm/amd-iommu-proto.h>
  
-/* Printouts */
-#define P2M_PRINTK(_f, _a...)                                \
-    debugtrace_printk("p2m: %s(): " _f, __func__, ##_a)
-#define P2M_ERROR(_f, _a...)                                 \
-    printk("pg error: %s(): " _f, __func__, ##_a)
-#if P2M_DEBUGGING
-#define P2M_DEBUG(_f, _a...)                                 \
-    debugtrace_printk("p2mdebug: %s(): " _f, __func__, ##_a)
-#else
-#define P2M_DEBUG(_f, _a...) do { (void)(_f); } while(0)
-#endif
-
 
 /* Override macros from asm/page.h to make them work with mfn_t */
 #undef mfn_to_page
 #undef page_to_mfn
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
-#if P2M_AUDIT
-extern void audit_p2m(struct p2m_domain *p2m, int strict_m2p);
-#else
-# define audit_p2m(_p2m, _m2p) do { (void)(_p2m),(_m2p); } while (0)
-#endif /* P2M_AUDIT */
-
 #define SUPERPAGE_PAGES (1UL << 9)
 #define superpage_aligned(_x)  (((_x)&(SUPERPAGE_PAGES-1))==0)
 
index b1f96f04fef0d913a26c5c37a1aa334d51c2b08f..3b87045f26edda426200179970bbfc5a45250d91 100644 (file)
 #include <asm/hvm/nestedhvm.h>
 #include <asm/hvm/svm/amd-iommu-proto.h>
 
-/* Debugging and auditing of the P2M code? */
-#define P2M_AUDIT     0
-#define P2M_DEBUGGING 0
-
-/* Printouts */
-#define P2M_PRINTK(_f, _a...)                                \
-    debugtrace_printk("p2m: %s(): " _f, __func__, ##_a)
-#define P2M_ERROR(_f, _a...)                                 \
-    printk("pg error: %s(): " _f, __func__, ##_a)
-#if P2M_DEBUGGING
-#define P2M_DEBUG(_f, _a...)                                 \
-    debugtrace_printk("p2mdebug: %s(): " _f, __func__, ##_a)
-#else
-#define P2M_DEBUG(_f, _a...) do { (void)(_f); } while(0)
-#endif
-
-
 /* Override macros from asm/page.h to make them work with mfn_t */
 #undef mfn_to_page
 #define mfn_to_page(_m) __mfn_to_page(mfn_x(_m))
@@ -113,11 +96,6 @@ unsigned long p2m_type_to_flags(p2m_type_t t, mfn_t mfn)
     }
 }
 
-#if P2M_AUDIT
-void audit_p2m(struct p2m_domain *p2m, int strict_m2p);
-#else
-# define audit_p2m(_p2m, _m2p) do { (void)(_p2m),(_m2p); } while (0)
-#endif /* P2M_AUDIT */
 
 // Find the next level's P2M entry, checking for out-of-range gfn's...
 // Returns NULL on error.
index 13f14033ab5e0a1304920e65b01a5ac315f50e6f..aba199e7768188b4c5ae56cf6e5ded8c8308add5 100644 (file)
@@ -65,14 +65,6 @@ boolean_param("hap_2mb", opt_hap_2mb);
 #undef page_to_mfn
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
-#if P2M_AUDIT
-extern void audit_p2m(struct p2m_domain *p2m, int strict_m2p);
-#else
-# define audit_p2m(_p2m, _m2p) do { (void)(_p2m),(_m2p); } while (0)
-#endif /* P2M_AUDIT */
-
-/* XXX declare functions moved to p2m-pt.c */
-extern void p2m_pt_init(struct p2m_domain *p2m);
 
 /* Init the datastructures for later use by the p2m code */
 static void p2m_initialise(struct domain *d, struct p2m_domain *p2m)
index 03961cfd1eaebb0a2300b3d37abf458bbeb35087..1ec6d62fdf568a7cc7f4b11eb6e2c52e3cbf715d 100644 (file)
@@ -875,8 +875,6 @@ const struct paging_mode *paging_get_mode(struct vcpu *v)
     return paging_get_nestedmode(v);
 }
 
-extern const struct paging_mode *hap_paging_get_mode(struct vcpu *);
-
 void paging_update_nestedmode(struct vcpu *v)
 {
     ASSERT(nestedhvm_enabled(v->domain));
index e15dd0a95d253efefae4eb7fa7341e066f6feb96..4f188546fd73eaaed9880976ed86de36525383a5 100644 (file)
@@ -9,6 +9,7 @@
 #include <xen/guest_access.h>
 #include <xen/iocap.h>
 #include <asm/current.h>
+#include <asm/io_apic.h>
 #include <asm/msi.h>
 #include <asm/hypercall.h>
 #include <public/xen.h>
 typedef long ret_t;
 #endif
 
-int
-ioapic_guest_read(
-    unsigned long physbase, unsigned int reg, u32 *pval);
-int
-ioapic_guest_write(
-    unsigned long physbase, unsigned int reg, u32 pval);
-
 static int physdev_hvm_map_pirq(
     struct domain *d, struct physdev_map_pirq *map)
 {
index 2733fc3b9e689d458563d27d9d382d655511f6ff..022c6a7e188a9ff25a1466f50258905e77af768d 100644 (file)
@@ -20,6 +20,7 @@
 #include <xen/guest_access.h>
 #include <xen/acpi.h>
 #include <xen/cpu.h>
+#include <xen/pmstat.h>
 #include <asm/current.h>
 #include <public/platform.h>
 #include <acpi/cpufreq/processor_perf.h>
@@ -47,9 +48,6 @@ extern spinlock_t xenpf_lock;
 
 static DEFINE_PER_CPU(uint64_t, freq);
 
-extern int set_px_pminfo(uint32_t cpu, struct xen_processor_performance *perf);
-extern long set_cx_pminfo(uint32_t cpu, struct xen_processor_power *power);
-
 static long cpu_frequency_change_helper(void *data)
 {
     return cpu_frequency_change(this_cpu(freq));
index deab8f760774f60449904c2b3544ecc673f819c1..44ee79c6489372aa642827d8ea84266678159437 100644 (file)
@@ -213,7 +213,6 @@ void smp_callin(void)
 
     if ( (rc = hvm_cpu_up()) != 0 )
     {
-        extern void (*dead_idle) (void);
         printk("CPU%d: Failed to initialise HVM. Not coming online.\n", cpu);
         cpu_error = rc;
         clear_local_APIC();
@@ -840,7 +839,6 @@ remove_siblinginfo(int cpu)
 
 void __cpu_disable(void)
 {
-    extern void fixup_irqs(void);
     int cpu = smp_processor_id();
 
     set_cpu_state(CPU_STATE_DYING);
index 042bde4c4622f28727419309154309056f315710..93f01c23f06ad5cf615dd2a94f068b896aec7632 100644 (file)
@@ -11,6 +11,7 @@
 #include <xen/lib.h>
 #include <xen/mm.h>
 #include <xen/guest_access.h>
+#include <xen/hypercall.h>
 #include <public/sysctl.h>
 #include <xen/sched.h>
 #include <xen/event.h>
@@ -56,8 +57,6 @@ long cpu_down_helper(void *data)
     return ret;
 }
 
-extern int __node_distance(int a, int b);
-
 long arch_do_sysctl(
     struct xen_sysctl *sysctl, XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
 {
index 35cde514e766f30c0b8e5299079b31a4ce7e9c8a..c30b3e0f6aef99e620622daabc60a98f738d984f 100644 (file)
@@ -69,6 +69,7 @@
 #include <asm/hypercall.h>
 #include <asm/mce.h>
 #include <asm/apic.h>
+#include <asm/hpet.h>
 #include <public/arch-x86/cpuid.h>
 
 /*
@@ -1634,8 +1635,6 @@ static uint32_t guest_io_read(
     return data;
 }
 
-extern void (*pv_rtc_handler)(unsigned int port, uint8_t value);
-
 static void guest_io_write(
     unsigned int port, unsigned int bytes, uint32_t data,
     struct vcpu *v, struct cpu_user_regs *regs)
index c50b146695e88eb5cc2574903e5b9350e49af00f..7751557bfa5356e0dbbd42c3798f7036052aab77 100644 (file)
@@ -21,8 +21,6 @@
 
 #include <public/callback.h>
 
-extern asmlinkage int hypercall(void);
-
 static void print_xen_info(void)
 {
     char taint_str[TAINT_STRING_MAX_LEN];
index c26248e97b1efc8d254ac79a2b9f94b930bbc362..3e7422fee4d96db1e6ee06443de4c23f302bb7c3 100644 (file)
@@ -28,6 +28,7 @@
 #include <xen/types.h>
 #include <xen/xmalloc.h>
 #include <xen/guest_access.h>
+#include <xen/pmstat.h>
 #include <compat/platform.h>
 
 CHECK_processor_csd;
@@ -35,15 +36,6 @@ CHECK_processor_csd;
 DEFINE_XEN_GUEST_HANDLE(compat_processor_csd_t);
 DEFINE_XEN_GUEST_HANDLE(compat_processor_cx_t);
 
-#define xlat_page_start ((unsigned long)COMPAT_ARG_XLAT_VIRT_BASE)
-#define xlat_page_size  COMPAT_ARG_XLAT_SIZE
-#define xlat_page_left_size(xlat_page_current) \
-    (xlat_page_start + xlat_page_size - xlat_page_current)
-
-#define xlat_malloc_init(xlat_page_current)    do { \
-    xlat_page_current = xlat_page_start; \
-} while (0)
-
 void *xlat_malloc(unsigned long *xlat_page_current, size_t size)
 {
     void *ret;
@@ -60,8 +52,6 @@ void *xlat_malloc(unsigned long *xlat_page_current, size_t size)
     return ret;
 }
 
-#define xlat_malloc_array(_p, _t, _c) ((_t *) xlat_malloc(&_p, sizeof(_t) * _c))
-
 static int copy_from_compat_state(xen_processor_cx_t *xen_state,
                                   compat_processor_cx_t *state)
 {
@@ -78,8 +68,6 @@ static int copy_from_compat_state(xen_processor_cx_t *xen_state,
     return 0;
 }
 
-extern long set_cx_pminfo(uint32_t cpu, struct xen_processor_power *power);
-
 long compat_set_cx_pminfo(uint32_t cpu, struct compat_processor_power *power)
 {
     struct xen_processor_power *xen_power;
index d005dfdc6d2e18e2c78a5515e696cf8f37894411..ce9864e1875dc7e9737ed5ef0b56d57242d557cb 100644 (file)
 #include <xen/types.h>
 #include <xen/xmalloc.h>
 #include <xen/guest_access.h>
+#include <xen/pmstat.h>
 #include <compat/platform.h>
 
 DEFINE_XEN_GUEST_HANDLE(compat_processor_px_t);
 
-#define xlat_page_start ((unsigned long)COMPAT_ARG_XLAT_VIRT_BASE)
-
-#define xlat_malloc_init(xlat_page_current)    do { \
-    xlat_page_current = xlat_page_start; \
-} while (0)
-
-extern void *xlat_malloc(unsigned long *xlat_page_current, size_t size);
-
-#define xlat_malloc_array(_p, _t, _c) ((_t *) xlat_malloc(&_p, sizeof(_t) * _c))
-
-extern int 
-set_px_pminfo(uint32_t cpu, struct xen_processor_performance *perf);
-
 int 
 compat_set_px_pminfo(uint32_t cpu, struct compat_processor_performance *perf)
 {
index c7054755383102e13f7438db7e54feca3f85c21c..d5380f8a461d56fedfa7d4349640c3cb40608015 100644 (file)
@@ -582,8 +582,6 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
     return ret;
 }
 
-void schedule_dump(struct cpupool *c);
-
 void dump_runq(unsigned char key)
 {
     unsigned long    flags;
index 5e13094518aadc3b0e5d16981e077800e046bc75..5f7194dc880633d01fa22d971c9d5b5a25eadc71 100644 (file)
 #include <xen/guest_access.h>
 #include <xen/bitmap.h>
 #include <xen/paging.h>
+#include <xen/hypercall.h>
 #include <asm/current.h>
 #include <public/domctl.h>
 #include <xsm/xsm.h>
 
 static DEFINE_SPINLOCK(domctl_lock);
 
-extern long arch_do_domctl(
-    struct xen_domctl *op, XEN_GUEST_HANDLE(xen_domctl_t) u_domctl);
-
 int cpumask_to_xenctl_cpumap(
     struct xenctl_cpumap *xenctl_cpumap, cpumask_t *cpumask)
 {
index c061a0d838b7a2d683f9391835f752a996ca0b2c..5558dc0712ab81eb1a65e6251e519c90567e05cb 100644 (file)
@@ -18,6 +18,7 @@
 #include <public/version.h>
 #ifdef CONFIG_X86
 #include <asm/shared.h>
+#include <asm/setup.h>
 #endif
 
 #ifndef COMPAT
@@ -237,7 +238,6 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDLE(void) arg)
     case XENVER_capabilities:
     {
         xen_capabilities_info_t info;
-        extern void arch_get_xen_caps(xen_capabilities_info_t *info);
 
         memset(info, 0, sizeof(info));
         arch_get_xen_caps(&info);
index 662d7e994e925796551d3c61d03726ceb2a68e2d..f5c4adc1b652393c50e5f3882b9b7effb5e58424 100644 (file)
@@ -14,6 +14,7 @@
 #include <xen/rangeset.h>
 #include <xen/compat.h>
 #include <xen/ctype.h>
+#include <xen/perfc.h>
 #include <asm/debugger.h>
 #include <asm/div64.h>
 
@@ -403,7 +404,6 @@ static struct keyhandler read_clocks_keyhandler = {
     .desc = "display multi-cpu clock info"
 };
 
-extern void dump_runq(unsigned char key);
 static struct keyhandler dump_runq_keyhandler = {
     .diagnostic = 1,
     .u.fn = dump_runq,
@@ -411,13 +411,11 @@ static struct keyhandler dump_runq_keyhandler = {
 };
 
 #ifdef PERF_COUNTERS
-extern void perfc_printall(unsigned char key);
 static struct keyhandler perfc_printall_keyhandler = {
     .diagnostic = 1,
     .u.fn = perfc_printall,
     .desc = "print performance counters"
 };
-extern void perfc_reset(unsigned char key);
 static struct keyhandler perfc_reset_keyhandler = {
     .u.fn = perfc_reset,
     .desc = "reset performance counters"
@@ -425,13 +423,11 @@ static struct keyhandler perfc_reset_keyhandler = {
 #endif
 
 #ifdef LOCK_PROFILE
-extern void spinlock_profile_printall(unsigned char key);
 static struct keyhandler spinlock_printall_keyhandler = {
     .diagnostic = 1,
     .u.fn = spinlock_profile_printall,
     .desc = "print lock profile info"
 };
-extern void spinlock_profile_reset(unsigned char key);
 static struct keyhandler spinlock_reset_keyhandler = {
     .u.fn = spinlock_profile_reset,
     .desc = "reset lock profile info"
index 5365c20f297029caf05f1f672b38cdb7d91a0620..5cd514415133df2867239af36738dcca75085a4d 100644 (file)
 #include <xsm/xsm.h>
 #include <xen/pmstat.h>
 
-extern long arch_do_sysctl(
-    struct xen_sysctl *op, XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl);
-#ifdef LOCK_PROFILE
-extern int spinlock_profile_control(xen_sysctl_lockprof_op_t *pc);
-#endif
-
 long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
 {
     long ret = 0;
index 67b022325cd02cdba57d1dd780cddc195e5e5893..d918c9ca6296b4dd853ab17122fd21408b19ee84 100644 (file)
@@ -452,7 +452,6 @@ void hvm_dpci_msi_eoi(struct domain *d, int vector)
     spin_unlock(&d->event_lock);
 }
 
-extern int vmsi_deliver(struct domain *d, int pirq);
 static int hvm_pci_msi_assert(struct domain *d, int pirq)
 {
     if ( hvm_domain_use_pirq(d, pirq) )
index 6a33d7e55799fe58d1778d764cc28ddb37c676a1..50d0f7d35886a701ca9898b497da6f1824780c87 100644 (file)
@@ -25,6 +25,7 @@
 #include <xen/iommu.h>
 #include <xen/numa.h>
 #include <asm/fixmap.h>
+#include <asm/setup.h>
 #include "../iommu.h"
 #include "../dmar.h"
 #include "../vtd.h"
@@ -113,7 +114,6 @@ void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq)
 void __init iommu_set_dom0_mapping(struct domain *d)
 {
     unsigned long i, j, tmp, top;
-    extern int xen_in_range(unsigned long mfn);
 
     BUG_ON(d->domain_id != 0);
 
index 356af443ec44411d3990fba1ea0e924ce67d2bb2..41322e26109f32321cfa7682bc9b25517370babe 100644 (file)
@@ -150,6 +150,7 @@ void acpi_mmcfg_init(void);
 extern uint32_t system_reset_counter;
 
 void hvm_acpi_power_button(struct domain *d);
+void hvm_acpi_sleep_button(struct domain *d);
 
 /* suspend/resume */
 void save_rest_processor_state(void);
index 9fea5d64e863878ae021545affa54200c5f24766..e47935f631aab6cdacd2744610081b05dc02be85 100644 (file)
@@ -77,4 +77,9 @@ static inline int debugger_trap_entry(
     return 0;
 }
 
+typedef unsigned long dbgva_t;
+typedef unsigned char dbgbyte_t;
+extern int dbg_rw_mem(dbgva_t addr, dbgbyte_t *buf, int len,
+                      domid_t domid, int toaddr, uint64_t pgd3);
+
 #endif /* __X86_DEBUGGER_H__ */
index 6183049695673f492b33047d2ce3dab2801fc9f8..4d01f1b5d9432d46c0f0405b4e615ea40d47d824 100644 (file)
@@ -97,6 +97,8 @@ int   hap_track_dirty_vram(struct domain *d,
                            unsigned long nr,
                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
 
+extern const struct paging_mode *hap_paging_get_mode(struct vcpu *);
+
 #endif /* XEN_HAP_H */
 
 /*
index 702fd016f1a64743316eda79f190377f7186e1c8..550958cf29d66288ccc35ff13c5ff663352b0865 100644 (file)
@@ -74,4 +74,6 @@ void hpet_broadcast_exit(void);
 int hpet_broadcast_is_available(void);
 void hpet_disable_legacy_broadcast(void);
 
+extern void (*pv_rtc_handler)(unsigned int port, uint8_t value);
+
 #endif /* __X86_HPET_H__ */
index 1e5f7ec5fcc90b9122b9e1f386892e77134968d8..3ce78d75781140dacf3e611dda5c5b84715f0bfe 100644 (file)
@@ -174,6 +174,10 @@ struct hvm_function_table {
 extern struct hvm_function_table hvm_funcs;
 extern bool_t hvm_enabled;
 extern bool_t cpu_has_lmsl;
+extern s8 hvm_port80_allowed;
+
+extern struct hvm_function_table *start_svm(void);
+extern struct hvm_function_table *start_vmx(void);
 
 int hvm_domain_initialise(struct domain *d);
 void hvm_domain_relinquish_resources(struct domain *d);
@@ -195,6 +199,7 @@ void hvm_init_guest_time(struct domain *d);
 void hvm_set_guest_time(struct vcpu *v, u64 guest_time);
 u64 hvm_get_guest_time(struct vcpu *v);
 
+int vmsi_deliver(struct domain *d, int pirq);
 int hvm_girq_dest_2_vcpu_id(struct domain *d, uint8_t dest, uint8_t dest_mode);
 
 #define hvm_paging_enabled(v) \
index a6615e895ee84c911be09ec9fd300ee50918c68b..cb9fb331eaf539970a85f87510958be1ce3db3d3 100644 (file)
@@ -101,6 +101,11 @@ arch_do_domctl(
     struct xen_domctl *domctl,
     XEN_GUEST_HANDLE(xen_domctl_t) u_domctl);
 
+extern long
+arch_do_sysctl(
+    struct xen_sysctl *op, 
+    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl);
+
 extern int
 do_kexec(
     unsigned long op, unsigned arg1, XEN_GUEST_HANDLE(void) uarg);
index 7179a9ee75acae9e3748e471bbc42ac3b0b67d96..2e4d62046a5fc3521cefe48da60f2c70df11cb70 100644 (file)
@@ -52,4 +52,8 @@ __OUT(l,,int)
 
 extern void (*pv_post_outb_hook)(unsigned int port, u8 value);
 
+/* Function pointer used to handle platform specific I/O port emulation. */
+extern void (*ioemul_handle_quirk)(
+    u8 opcode, char *io_emul_stub, struct cpu_user_regs *regs);
+
 #endif
index 02c4b71f5302dec23e34a35c54f974dd52dcd227..4bbbbe79d38371cdcaa4cd1eefade7bc509564e2 100644 (file)
@@ -198,6 +198,8 @@ extern void init_ioapic_mappings(void);
 extern void ioapic_suspend(void);
 extern void ioapic_resume(void);
 
+extern void dump_ioapic_irq_info(void);
+
 extern struct IO_APIC_route_entry **alloc_ioapic_entries(void);
 extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries);
 extern int save_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries);
@@ -215,4 +217,7 @@ extern int free_irq_vector(int vector);
 
 unsigned highest_gsi(void);
 
+int ioapic_guest_read( unsigned long physbase, unsigned int reg, u32 *pval);
+int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 pval);
+
 #endif
index 2e8322a05e6ae72214fa611a76b4ead08c121ec5..5399cb55c4e37b932d23cdade9bd0f169507879c 100644 (file)
@@ -116,6 +116,9 @@ int map_domain_emuirq_pirq(struct domain *d, int pirq, int irq);
 int unmap_domain_pirq_emuirq(struct domain *d, int pirq);
 int hvm_domain_use_pirq(struct domain *d, int irq);
 
+/* A cpu has been removed from cpu_online_mask.  Re-set irq affinities. */
+void fixup_irqs(void);
+
 int  init_irq_data(void);
 
 void clear_irq_vector(int irq);
index abe7468446c833e9f0a6233ef4a5c5175f4c2a33..07d31bb249079143944678465a9565c62ead96bb 100644 (file)
@@ -83,5 +83,6 @@ extern int valid_numa_range(u64 start, u64 end, int node);
 #endif
 
 void srat_parse_regions(u64 addr);
+extern int __node_distance(int a, int b);
 
 #endif
index f097a35ef3f361f6b4838902b2cc601f9317981e..0bf9545ac775703196d946e8fb6e120e691c00fe 100644 (file)
@@ -666,6 +666,31 @@ static inline int p2m_gfn_check_limit(
 int set_p2m_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn, 
                   unsigned int page_order, p2m_type_t p2mt, p2m_access_t p2ma);
 
+/* Set up function pointers for PT implementation: only for use by p2m code */
+extern void p2m_pt_init(struct p2m_domain *p2m);
+
+/* Debugging and auditing of the P2M code? */
+#define P2M_AUDIT     0
+#define P2M_DEBUGGING 0
+
+#if P2M_AUDIT
+extern void audit_p2m(struct p2m_domain *p2m, int strict_m2p);
+#else
+# define audit_p2m(_p2m, _m2p) do { (void)(_p2m),(_m2p); } while (0)
+#endif /* P2M_AUDIT */
+
+/* Printouts */
+#define P2M_PRINTK(_f, _a...)                                \
+    debugtrace_printk("p2m: %s(): " _f, __func__, ##_a)
+#define P2M_ERROR(_f, _a...)                                 \
+    printk("pg error: %s(): " _f, __func__, ##_a)
+#if P2M_DEBUGGING
+#define P2M_DEBUG(_f, _a...)                                 \
+    debugtrace_printk("p2mdebug: %s(): " _f, __func__, ##_a)
+#else
+#define P2M_DEBUG(_f, _a...) do { (void)(_f); } while(0)
+#endif
+
 #endif /* _XEN_P2M_H */
 
 /*
index f9fbf39d628ffda3a62f927cba59faf131a3b4d3..7272dfa05842cd55d985a033ec9ff984880ae1a9 100644 (file)
@@ -580,6 +580,7 @@ DECLARE_TRAP_HANDLER(machine_check);
 DECLARE_TRAP_HANDLER(alignment_check);
 DECLARE_TRAP_HANDLER(spurious_interrupt_bug);
 #undef DECLARE_TRAP_HANDLER
+extern asmlinkage int hypercall(void);
 
 int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
           uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
index 9f1ef7c0b233a921796d69f4147e7585f917f270..f7d6345eab9d35224bf64a81520125a9dc633f5d 100644 (file)
@@ -2,6 +2,7 @@
 #define __X86_SETUP_H_
 
 #include <xen/multiboot.h>
+#include <public/version.h>
 
 extern bool_t early_boot;
 extern unsigned long xenheap_initial_phys_start;
@@ -38,4 +39,7 @@ int construct_dom0(
 unsigned long initial_images_nrpages(void);
 void discard_initial_images(void);
 
+int xen_in_range(unsigned long mfn);
+void arch_get_xen_caps(xen_capabilities_info_t *info);
+
 #endif
index e7dc66cf09cfcd3211148635af4cdbb2f4090cf4..88a8cd2da32aa983fb58dbf7421f122bb1010c3a 100644 (file)
@@ -115,6 +115,9 @@ static inline void shadow_remove_all_shadows(struct vcpu *v, mfn_t gmfn)
     sh_remove_shadows(v, gmfn, 0 /* Be thorough */, 1 /* Must succeed */);
 }
 
+/* Discard _all_ mappings from the domain's shadows. */
+void shadow_blow_tables_per_domain(struct domain *d);
+
 #endif /* _XEN_SHADOW_H */
 
 /*
index e35ce28e03f0ffc6e8f095aad156cc96b2ebcfc0..475bea216e07fca71e152fc00279750fecfb81db 100644 (file)
@@ -14,6 +14,19 @@ void free_compat_arg_xlat(struct vcpu *v);
     ((__off + (unsigned long)(size)) <= COMPAT_ARG_XLAT_SIZE);                \
 })
 
+#define xlat_page_start ((unsigned long)COMPAT_ARG_XLAT_VIRT_BASE)
+#define xlat_page_size  COMPAT_ARG_XLAT_SIZE
+#define xlat_page_left_size(xlat_page_current) \
+    (xlat_page_start + xlat_page_size - xlat_page_current)
+
+#define xlat_malloc_init(xlat_page_current)    do { \
+    xlat_page_current = xlat_page_start; \
+} while (0)
+
+extern void *xlat_malloc(unsigned long *xlat_page_current, size_t size);
+
+#define xlat_malloc_array(_p, _t, _c) ((_t *) xlat_malloc(&_p, sizeof(_t) * _c))
+
 /*
  * Valid if in +ve half of 48-bit address space, or above Xen-reserved area.
  * This is also valid for range checks (addr, addr+size). As long as the
index bbdadb4ac4754b4a506a1e56aa668a563f7f865b..528506369640d7ed60d5fef4a70e1975ce90c8bd 100644 (file)
@@ -95,4 +95,6 @@ extern void cpuidle_wakeup_mwait(cpumask_t *mask);
 
 #define CPUIDLE_DRIVER_STATE_START  1
 
+extern void menu_get_trace_data(u32 *expected, u32 *pred);
+
 #endif /* _XEN_CPUIDLE_H */
index 9b51004c38452ee118306a44419595fa9b4c5a54..26df1ac9ac05d218f1da1337dcaeed5761e49bfd 100644 (file)
@@ -34,6 +34,12 @@ void kexec_crash_save_cpu(void);
 crash_xen_info_t *kexec_crash_save_info(void);
 void machine_crash_shutdown(void);
 int machine_kexec_get(xen_kexec_range_t *range);
+int machine_kexec_get_xen(xen_kexec_range_t *range);
+
+void compat_machine_kexec(unsigned long rnk,
+                          unsigned long indirection_page,
+                          unsigned long *page_list,
+                          unsigned long start_address);
 
 /* vmcoreinfo stuff */
 #define VMCOREINFO_BYTES           (4096)
index 40c98473352c3ce93df0c0b81828363377d4b3ea..79082d1721db6a680546f4b768dd567d2d439b27 100644 (file)
@@ -119,6 +119,7 @@ int pci_find_ext_capability(int seg, int bus, int devfn, int cap);
 
 int msixtbl_pt_register(struct domain *d, int pirq, uint64_t gtable);
 void msixtbl_pt_unregister(struct domain *d, int pirq);
+void msixtbl_pt_cleanup(struct domain *d);
 void pci_enable_acs(struct pci_dev *pdev);
 
 #endif /* __XEN_PCI_H__ */
index 59353a34d4027ab65ffac75d1f858cf768435068..6cb0cd1739ed8b9ecf9c2c349f18dda744f79629 100644 (file)
@@ -95,6 +95,10 @@ DECLARE_PER_CPU(perfc_t[NUM_PERFCOUNTERS], perfcounters);
 
 struct xen_sysctl_perfc_op;
 int perfc_control(struct xen_sysctl_perfc_op *);
+
+extern void perfc_printall(unsigned char key);
+extern void perfc_reset(unsigned char key);
+
     
 #else /* PERF_COUNTERS */
 
index 979af239c786e9f6750146f3c947fa3627fe9f6b..266bc16d86e6f7c2d74968e8bddff925c431ab06 100644 (file)
@@ -5,6 +5,7 @@
 #include <public/platform.h> /* for struct xen_processor_power */
 #include <public/sysctl.h>   /* for struct pm_cx_stat */
 
+int set_px_pminfo(uint32_t cpu, struct xen_processor_performance *perf);
 long set_cx_pminfo(uint32_t cpu, struct xen_processor_power *power);
 uint32_t pmstat_get_cx_nr(uint32_t cpuid);
 int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_stat *stat);
index 7b546d77b9525473e261a0acb2b9dd2252dfa134..e3eab706a3435fb63f66d267f30ae573946bbb28 100644 (file)
@@ -534,6 +534,9 @@ void continue_running(
     struct vcpu *same);
 
 void startup_cpu_idle_loop(void);
+extern void (*pm_idle) (void);
+extern void (*dead_idle) (void);
+
 
 /*
  * Creates a continuation to resume the current hypercall. The caller should
@@ -653,6 +656,9 @@ void cpupool_put(struct cpupool *pool);
 int cpupool_add_domain(struct domain *d, int poolid);
 void cpupool_rm_domain(struct domain *d);
 int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op);
+void schedule_dump(struct cpupool *c);
+extern void dump_runq(unsigned char key);
+
 #define num_cpupool_cpus(c) (cpus_weight((c)->cpu_valid))
 
 #endif /* __SCHED_H__ */
index dd1550ca58affe3f04f102df218239ec91624e49..6400c2b61666eda0a800d21fcc57e2acbffc7910 100644 (file)
@@ -98,6 +98,10 @@ void _lock_profile_deregister_struct(int32_t, struct lock_profile_qhead *);
 #define lock_profile_deregister_struct(type, ptr)                             \
     _lock_profile_deregister_struct(type, &((ptr)->profile_head))
 
+extern int spinlock_profile_control(xen_sysctl_lockprof_op_t *pc);
+extern void spinlock_profile_printall(unsigned char key);
+extern void spinlock_profile_reset(unsigned char key);
+
 #else
 
 struct lock_profile { };
index 7539cc7d7b15ec5b83c5f6d2e05f75fb366e93b7..512c070c811aefe6663fbc90441e2c1c86a5f773 100644 (file)
@@ -636,4 +636,7 @@ static inline int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
 }
 #endif /* CONFIG_X86 */
 
+extern struct xsm_operations dummy_xsm_ops;
+extern void xsm_fixup_ops(struct xsm_operations *ops);
+
 #endif /* __XSM_H */
index b3d5a5b4f0ce2f2392c49dfc9cafb3fb39fc29fe..3396b3d7295ea60f98438ed0c5988994637ec7c8 100644 (file)
@@ -21,9 +21,6 @@
 
 #define XSM_FRAMEWORK_VERSION    "1.0.0"
 
-extern struct xsm_operations dummy_xsm_ops;
-extern void xsm_fixup_ops(struct xsm_operations *ops);
-
 struct xsm_operations *xsm_ops;
 
 static inline int verify(struct xsm_operations *ops)